﻿using FunArts.EasyDevOps.Shared.Models.SshClient.NginxClient;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace FunArts.EasyDevOps.Rcl.Repertories
{
    /// <summary>
    /// Nginx配置文件仓储
    /// </summary>
    public interface INginxConfigRepertory
    {
        string GenerateConfig(NginxServerConfig config);

        /// <summary>
        /// 从文件加载Nginx配置
        /// </summary>
        /// <param name="filePath"></param>
        /// <returns></returns>
        NginxServerConfig LoadConfigFromFile(string filePath);
        /// <summary>
        /// 解析Nginx配置
        /// </summary>
        /// <param name="configText"></param>
        /// <returns></returns>
        NginxServerConfig ParseConfig(string configText);

        /// <summary>
        /// 保存Nginx配置到文件
        /// </summary>
        /// <param name="config"></param>
        /// <param name="filePath"></param>
        void SaveConfigToFile(NginxServerConfig config, string filePath);
    }
}
